<?php

namespace app\validate;

use think\Validate;

class ApprovalValidate extends Validate
{
    protected $rule = [
        'id' => 'require',
        'type' => 'require|in:100,200',
        'department_id' => 'require',
        'user_id' => 'require',
    ];

    protected $message = [
        'type.require' => '请选择审批类型',
        'type.in' => '审批类型错误',
        'department_id.require' => '请选择部门',
        'user_id.require' => '请选择审批人',
        'id.require' => '请选择审批节点',
    ];

    protected $scene = [
        'create' => ['type', 'department_id', 'user_id'],
        'getDepartmentUserList' => ['department_id'],
        'edit' => ['id', 'type', 'department_id', 'user_id'],
        'del' => ['id'],
    ];
}